/**
 * 获取水果的价格
 * @param name
 */
const getFruitPrice = (name: string) => {
    let price: number = 0.0
    if (name === '苹果') {
        price = 5.01
    } else if (name === '香蕉') {
        price = 4.99
    } else if (name === '榴莲') {
        price = 12.02
    }
    if (price > 0) {
        return `${name}${price}元/斤`
    } else {
        return `没有查询到该水果的价格，您可以输入苹果、香蕉或榴莲试试`
    }
}
/**
 * 获取当前日期
 */
const getCurrentDate = () => {
    const now = new Date();

    // 获取年月日
    const year = now.getFullYear();
    const month = String(now.getMonth() + 1).padStart(2, '0');
    const day = String(now.getDate()).padStart(2, '0');

    // 获取星期
    const days = ['日', '一', '二', '三', '四', '五', '六'];
    const dayOfWeek = days[now.getDay()];

    return `今天是${year}年${month}月${day}日星期${dayOfWeek}`
}
export {getFruitPrice, getCurrentDate}
